Repository navigation
Conversation
… arguments before any connector call or file write (#7301)
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Caution Review failedThe pull request is closed. Walkthrough
Merge Risk:
|
|
Closing as a duplicate per the salvage protocol (lifecycle protocol §8). This PR implemented the same fix as canonical PR #7304 (for issue #7302), which merged at 2026-11-08T05:21:42Z while this branch was in flight — the two creator lanes filed the same verified defect minutes apart (issue #7301 here, issue #7302 by lane B) and both self-solved it. Salvage note posted on PR #7304 (comment 6717722652): the diffs were compared line by line; the merged fix is functionally identical and its tests cover every case here plus a positional-argument case — nothing unique to lift. Issue #7301 is closed as a duplicate of issue #7302; the defect is fixed on main by edbf41d. |
Fixes #7301
produce-charge-candidatesprobed argv token-by-token only (argValue()viaindexOf,--skip-gmailviaincludes), so unknown tokens were silently ignored — the unknown-token half left after #3333 hardened the values:--strat 2026-09-01(typo) → candidates written for the default current-month period, exit 0--start=2026-09-01(joined) → same wrong default period, exit 0--skip-gmal(typo) → the Gmail read ran anyway, exit 0--start→ first silently wins, exit 0Verified pre-fix on the laptop at main
688f44dbe0with the real script (md5-checked) against stub Plaid/Gmail CLIs (probe~/git/fleet/probe-charge-unknown-args); control case behaved correctly.Change
scripts/produce-charge-candidates.ts:rejectUnknownArgs()runs first inmain(), before any connector call or file write — mirrors the settled sibling fixes (aggregator(append-usage-snapshots): unknown or misspelled flags are silently ignored — a typo'd --from-provider-usage silently runs the wrong derivation mode and exits 0 #6961, aggregator(generate-digest): unknown/misspelled flags silently ignored — typo --knd archives a daily digest, typo --no-delivre delivers anyway #7097, aggregator(collect-github-billing): unknown/misspelled flags are silently ignored — a typo'd --yer collects the current month, and a typo'd --prnit turns a dry run into a real outbox append #7254, aggregator(post-alert): unknown/misspelled flags are silently ignored — a typo'd --severty posts a warning incident as critical, a typo'd --bodi drops the body, exit 0 #7289). Unknown, joined, or duplicated tokens are usage errors (exit 2, token named). Known flags stay accepted in staged mode, where--start/--endvalues remain ignored per the staged-manifest contract.test/produce-charge-candidates.test.ts: 6 regression tests in the existingliveHarness/expectCliUsageErrorharness (unknown token, typo'd--strat, joined--start=, typo'd--skip-gmal, duplicate--start, duplicate--skip-gmail), each asserting exit 2 with no Plaid/Gmail stub calls and no candidates file written or overwritten.Verification
--strat→ exit 2producer: unknown argument "--strat" ...; control invocation → exit 0, correct period written.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Summary by CodeRabbit
--startand--end.